<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>翻转后的数组</title>
		<script>
					// var arr = [10, 20, 30, 40, 50]; // 原始数组
					// var newArr = []; // 翻转后的数组
					// for (var i = 0; i < arr.length; i++) {
					//     newArr[i] = arr[arr.length - i - 1];
					// }
					// for (var i = 0; i < newArr.length; i++) {
					//    console.log(newArr[i])
					// }
					function fanzhuan(arr){
						var newArr = [];
						
						for (var i = 0; i < arr.length; i++) {
						    newArr[i] = arr[arr.length - i - 1];
						}
						for (var i = 0; i < newArr.length; i++) {
						   console.log(newArr[i]);
						}
						return newArr;
						}
						
						var arr =fanzhuan( [10, 20, 30, 40, 50]);
						console.log(arr);
						
				</script>
	</head>
	<body>
	</body>
</html>
